<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>安全策略管理</title>
<#include "/pages/include/head.ftl" />
<#import "/pages/import/images.ftl" as img />
<#import "/pages/import/helper.ftl" as h />
<style>
.error{
	color: red;
}
</style>
<script type="text/javascript">
$(function(){
	// 重置表单
	$("#policy-form").resetForm();
	$("#Select02").hide();
	
	// 密码有效期选择
	$("#expired-select").change(function(a){
		switch($(this).val()){
			case "0": 
				$("#Select02").hide();
				$("#passwordExpiredDays").val(0);
				break;
			case "2":
				$("#Select02").show();
				break;
		}
	});
	
	var selected = $("#passwordComplexity").attr("v");
	$("#passwordComplexity").children().each(function(index, domEle){
		if($(domEle).val() == selected){
			$(domEle).attr("selected", "selected");
		}
	});
});
$(function(){
	$("#policy-form").validate();
	$("#policy-form .submit").click(function(){
		$("#policy-form").ajaxSubmit({
			dataType: "json",
			success: function(responseText, statusText, xhr, element){
				alert("保存成功");
			}
		});
	});
});
</script>
<script>
function aSelect(value){
	if (value == 4) {
		document.getElementById('Select051').style.display="none";
		document.getElementById('Select052').style.display="none";
		document.getElementById('Select7').style.display="none";
	}
	if (value == 5) {
		document.getElementById('Select051').style.display="block";
		document.getElementById('Select052').style.display="block";
		document.getElementById('Select7').style.display="block";
	}
}
</script>
<script>
function bSelect(value){
	if (value == 6) {
		document.getElementById('Select7').style.display="none";
	}
	if (value == 7) {
		document.getElementById('Select7').style.display="block";
	}
}
</script>
</head>

<body>
<div class="page-top-bar">
<ul class="path">统一帐号管理<span>&gt;</span>安全策略管理</ul>
<ul class="page-control"><li></li></ul>
</div>
<div class="function-bar">
<ul class="business-info"></ul>
<ul class="form-function">
</ul>
</div>
<@s.form id="policy-form" action="/securityStrategy/save.action" namespace="/securityStrategy">
<input type="hidden" name="strategy.version" value="${strategy.version}"/>
<div class="form-container">
	<div class="form-title"><span class="form-title-into">新建功能实体</span></div>
  <table cellspacing="1" cellpadding="0" class="form-2column form-margin">
      <tr> 
        <th>密码最小长度：</th> 
        <td class="from-require"><input id="passwordMinLength" type="text" name="strategy.passwordMinLength" value="${strategy.passwordMinLength!}" class="required input-common input-word-10" /> 
          （请输入密码的位数，最小值为6，最大值为30）</td> 
      </tr> 
      <tr>
        <th><label for="commonityNumber">密码复杂度：</label></th>
        <td class="from-require">
        	<@s.select name="strategy.passwordComplexity" value="${strategy.passwordComplexity?string}" list='#@java.util.LinkedHashMap@{ "NUMERIC_AND_LETTER" : "数字+字母组合", "NUMERIC" : "纯数字", "LETTER" : "纯字母", "UNRESTRICTED" : "数字+字母+特殊字符" }' theme="simple"/>
        </td> 
      </tr> 
      <tr> 
        <th>密码有效期：</th>
        <td class="from-require"> <div>
            <ul> 
              <li style="float: left;"> 
                <select id="expired-select"> 
                  <option value="0" selected="selected">永不过期</option> 
                  <option value="2">日</option> 
                </select> 
              </li> 
              <li style="float: left;" id="Select02" style="display:none;"> 
                <input id="passwordExpiredDays" name="strategy.passwordExpiredDays" value="0" type="text" class="input-common input-word-5" /> 天 
              </li>
            </ul> 
          </div></td> 
      </tr> 
      <tr> 
        <th>会话有效期：</th> 
        <td class="from-require"><input type="text" size="5"  maxLength="3" value=30 disabled="disabled" /> 
          分钟 （用户以帐户登陆业务系统到帐户登出系统之间的期间，称为用户的一次会话）</td> 
      </tr> 
      <tr> 
        <th><label for="label">尝试登录次数：</label></th> 
        <td class="from-require">  
                <select class="select-word-10" onchange="aSelect(this.options [this.options.selectedIndex].value)" disabled="disabled">
                  <option value="4" selected>无次数限制</option> 
                  <option value="5" >按次</option> 
                </select> </td> 
      </tr> 
      <tr id="Select051" style="display:none;"> 
        <th><label for="label">尝试登录的时间段间隔：</label></th> 
        <td class="from-require"><div> 
            <ul> 
              <li style="float: left;">  
                <input id="" name="" type="text" class="input-common input-word-5" /> 分钟
              </li> 
              <li style="float: left;"> 
                <input id="" name="" type="text" class="input-common input-word-5" /> 
                次</li> 
            </ul> 
          </div></td> 
      </tr> 
      <tr id="Select052" style="display:none;"> 
        <th><label for="label">解锁方式：</label></th> 
        <td class="from-require">   
        	<select class="select-word-10" onchange="bSelect(this.options [this.options.selectedIndex].value)">
            	<option value="7" selected>自动解锁</option> 
            	<option value="6" >手动解锁</option> 
          	</select>
        </td> 
      </tr> 
      <tr id="Select7" style="display:none;"> 
        <th><label for="label">被锁定的时间间隔：</label></th> 
        <td class="from-require"><input id="accountLockingLifecycle" type="text" class="input-common input-word-5" size="5" /> 
            小时
</td> 
      </tr> 
 <tr> 
    <th><label for="label">是否使用验证码：</label></th> 
      <td class="from-require">   
       <select name="strategy.needCaptcha" class="select-word-10" >
       <option value="1">需要验证码</option> 
       <option value="0">不使用验证码</option> 
       </select></td> 
</tr> 
    </table>
<div class="form-title"></div>

<div class="main-form-btn">
	<div class="btn-order">
		<ul>
			<li class="left-normal" id="btn1_11"></li>
			<li class="middle-normal submit" id="btn1_12"><img src="../../images/ico16/ico-ok.gif" alt="" />确 定</li>
			<li class="right-normal" id="btn1_13"></li>
		</ul>
	</div>
</div>

</div>
</@s.form>
</body>
</html>
